{% extends "base_basic.html" %}
{% block title %}欢迎加入绿光{% endblock %}

{% block headerlink %}
<link href="/static/css/login_reg.css" rel="stylesheet" type="text/css" media="all" />
<link href="/static/css/common.css" rel="stylesheet" type="text/css" media="all" />
{% endblock %}

{% block content %}
<div class="content-area">
<h1>欢迎加入绿光</h1>
{% if register_success %}
<p style="margin-top:20px;color:#060;font-size:20px;">{{ username }}，你已成功加入绿光 :)</p>
<span class="blue-link" style="font-size:14px;">
<a href="{{ request.HOME_PAGE_URL }}accounts/login/">前往登录页</a>
</span>
{% else %}
<form name="form" method="post" action="{{ request.HOME_PAGE_URL }}accounts/register/">{% csrf_token %}

    <div class="item">
    <label>邮箱</label>
    <input id="email" name="email" type="text" class="basic-input" maxlength="60" value={{ p_email }}>
    {% if email_hasExist %}
    <span class="validate-error">该邮箱已经注册过了</span>
    {% else %}
    <span class="tip">用来登录绿光</span>
    {% endif %}
    </div>

    <div class="item">
    <label>密码</label>
    <input id="password" name="password1" type="password" class="basic-input" maxlength="20">
    <span class="tip">字母、数字或符号，最短6个字符，区分大小写</span>
    </div>
    
    <div class="item">
    <label>确认密码</label>
    <input id="password" name="password2" type="password" class="basic-input" maxlength="20">
    {% if password_notMatch %}
    <span class="validate-error">两次输入的密码不一致</span>
    {% else %}
    <span class="tip">请再次输入密码</span>
    {% endif %}
    </div>

    <div class="item">
    <label>名号</label>
    <input id="name" name="name" type="text" class="basic-input" maxlength="15" value={{ p_name }}>
    {% if name_hasExist %}
    <span class="validate-error">该名号已经被使用了</span>
    {% else %}
    <span class="tip">中、英文均可，最长14个英文或7个汉字</span>
    {% endif %}
    </div>

    <div class="item">
    <label>常居地</label>
    <select id="city" name="city" class="basic-select" value="" >
    {% if p_city == '厦门' %}
    <option>福州</option>
    <option selected="selected">厦门</option>
    {% else %}
    <option selected="selected">福州</option>
    <option>厦门</option>
    {% endif %}
    </select>
    <span class="tip"></span>   
    </div>
    
    <div class="item"  style="margin-top:25px">
    <label>&nbsp;</label>
    <input type="submit" value="注册" id="button" class="btn-submit enabled" title="阅读并同意绿光的《使用协议》方可注册。">
    </div>
</form>

{% endif %}

</div>
{% endblock %}